<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<h1>User Register</h1>

<c:url var="hotelsUrl" value="/hotels/register"/>
<form:form modelAttribute="hotel" action="${hotelsUrl}" method="post" cssClass="inline">
    <spring:hasBindErrors name="hotel">
			<div class="error">
				<spring:bind path="hotel.*">
					<c:forEach items="${status.errorMessages}" var="error">
						<span><c:out value="${error}"/></span><br>
					</c:forEach>
				</spring:bind>
			</div>
	</spring:hasBindErrors>
	<fieldset>
		<div class="span-8">			
			
			 
			<label for="address">address:</label>
			<form:input id="address" path="address"/><br/>
			<script type="text/javascript">
				Spring.addDecoration(new Spring.ElementDecoration({
					elementId : "address",
					widgetType : "dijit.form.ValidationTextBox",
					widgetAttrs : { required : true }}));
			</script>
		</div>
		<div class="span-3 last">
			<button id="proceed" type="submit">OK</button>
			<script type="text/javascript">
				Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));
			</script>
		</div>		
    </fieldset>
</form:form>

